package com.adtech.adms.system.service;

import java.util.List;

import com.adtech.adms.commons.tree.TreeNode;
import com.adtech.adms.system.pojo.Feature;
import com.adtech.adms.system.pojo.Role;
import com.adtech.adms.system.pojo.User;
import com.adtech.core.exception.ServiceException;

/**
 * 功能模块service
 * 定义功能模块业务操作接口
 * @author Dormin 
 * @since 2011-8-11 
 * 
 * @Copyright (C) AD Tech Workshop All Right Reserved
 */
public interface FeatureService {



	public List<TreeNode<Feature>> getFeatureTree(boolean allLevel,Role role);

	public void save(Feature feature)throws ServiceException;
	public List<Feature> getFeatureList();
	public List<TreeNode<Feature>> getFeatureListByUser(User user);

	public void delete(Long id) throws ServiceException;
	public Feature getFeatureById(Long id);
	public List<TreeNode<Feature>> getFeatureTree(Long id);
	public List<TreeNode<Feature>> getFeatureTree(User user,Long id);
	public List<TreeNode<Feature>> getFeatureTree(Long id, boolean allLevel,Role role);
	public List<TreeNode<Feature>> getTreeNodeListByFeatures(List<TreeNode<Feature>> features);

	/**
	 * 
	 * @function 检查模块编码是否重复
	 * @param feature 模块对象
	 *
	 * @return 不重复返回true,重复返回false
	 * @exception
	 *
	 * @author Dormin
	 * @history
	 *
	 */
	public boolean check(Feature feature);

	/**
	 * 通过菜单的code获取而级菜单
	 * @param code feature code
	 * @return
	 * @author 李源
	 */
	public Feature getSecondFeatureByCode(String code);
	
	/**
	 * 根据featureCode获得feature
	 * @param code
	 * @return
	 * @author Dormin
	 */
	public Feature getFeatureByCode(String code);
}
